package com.imchen.demov4;

import android.content.Context;
import android.util.Log;


/**
 * @Description
 * @Author imchen
 * @CreateTime 2019/10/15 11:00
 */
public class SmaliExample {
    private static String sName;
    private int mNumber;
    private int mInitNumber = 10;
    private static final String TAG = "SmaliExample";
    public static Context mContext;

    private SmaliExample() {
        this.mNumber = 20;
    }

    static {
        sName = "imchen";
    }

    public static String getAge(String name) {
        return sName;
    }

    private void setNumber(int number) {
        this.mNumber = number;
    }

    private static int getmNumber(String name) {
        return 10;
    }

    public void compare(int numuber) {
        int count = getmNumber("name");
        if (count > 5) {
            Log.d(TAG, "compare: ");
            setNumber(0);
        } else {
            count++;
            try {
                setNumber(count);

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    
    public static void showInterstitial(){
        try {
            Log.d(TAG, "showInterstitial: ");
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static  void sub(){
        int max=5;
        int current=getmNumber("123");
        int result= max-current;
    }

    public static int getSPInt(Context context,String key){
        return 1;
    }

    public static void setSPInt(Context context,String key,int value){

    }

    public static void setPurchase(Context context){

    }

    public static void showDialog(Context context,String title,String msg){

    }

    public void showVideoFive(Context context){
        int max=5;
        int count = getSPInt(context,"key");
        count++;
        int result=max-count;
        showInterstitial();
        if (count>=5){
            Demo.mActivity.finish();
            setPurchase(context);
        }else{
            showDialog(context,"提示","再看"+result+"次解锁自动朗读");
            setSPInt(context,"key",count);
        }
    }

    public String getStr(){
        return "app";
    }

}
